<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/recharge/rechargeOrder/rechargeOrder.js"></script>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css?v=20200825">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css?v=20200825">
    <%--<link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/skins/laydate.css">--%>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.css">
    <script src="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.js"></script>
    <style>
        .bootstrap-table .fixed-table-container .table thead th .th-inner{
            text-align: center !important;
        }
         .layui-card {
             box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .4) !important;
             text-align: center !important;
             border-top: 1px solid rgb(224, 224, 224);
         }

        .layui-card .layui-card-body {
            margin-top: 0 !important;
            font-size: 14px;
        }

        .layui-card .layui-card-header {
            background: rgba(30, 159, 255, 1);
            color: #fff;
        }

        .refreshTime span {
            font-weight: 700;
        }
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return'<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>财务管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>农行交易详情</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back();"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <input id="outTradeNo" name="outTradeNo" type="text" class="form-control longInput input-distance" placeholder="商户订单号或支付订单号">
                    <input id="startTime" name="startTime" type="text"
                           class="form-control layer-date shortInput "
                           placeholder="开始时间" style="margin-left: 8px">
                    <input id="endTime" name="endTime" type="text"
                           class="form-control layer-date input-distance shortInput "
                           placeholder="结束时间">
                    <button class="btn btn-success input-distance" onclick="rechargeOrder.reLoad1()">查询</button>
                    <div class="pull-left search fr exportNumInput">
                        <input id="count" name="count" type="text" class="form-control" autocomplete="off"
                               placeholder="导出条数">
                    </div>
                    <div class="pull-left search fr" style="margin-left: 6px">
                        <button class="btn btn-success exportBtn" onclick="rechargeOrder.exportRechargeOrder1()">导出</button>
                    </div>
                </div>
                <div class="row"
                     style="display: flex;justify-content: space-evenly;padding-bottom: 0.1rem;margin-top: 1px !important;padding-top: 10px !important;">
                    <div class="col-md-2 ">
                        <div class="layui-card">
                            <div class="layui-card-header">充值订单数量</div>
                            <div class="layui-card-body" id="rechargeOrderCount">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2 ">
                        <div class="layui-card">
                            <div class="layui-card-header">充值金额</div>
                            <div class="layui-card-body" id="amount">

                            </div>
                        </div>
                    </div>
                    <div class="col-md-2 ">
                        <div class="layui-card">
                            <div class="layui-card-header">减免金额</div>
                            <div class="layui-card-body" id="giveAmount">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2 ">
                        <div class="layui-card">
                            <div class="layui-card-header">实付金额</div>
                            <div class="layui-card-body" id="factAmount">
                            </div>
                        </div>
                    </div>
                <table id="exampleTable1" data-mobile-responsive="true">
                </table>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

    // //日期范围限制
    var start = {
        elem: '#startTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime").val("")
            end.min = datas
        }
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤

    function selectRechargeOrderStatistics() {
        $.ajax({
            url: prefix + "/selectRechargeOrderStatistics",
            type: "GET",
            data: {
                outTradeNo: $("#outTradeNo").val().trim(),
                startTime: $("#startTime").val().trim(),
                endTime: $("#endTime").val().trim()
            },
            success: function (data) {
                console.log(data)
                if (data.status == 200) {
                    if (data.data.rechargeOrderCount != null && data.data.rechargeOrderCount != '') {
                        document.getElementById("rechargeOrderCount").innerHTML = data.data.rechargeOrderCount;
                    } else {
                        document.getElementById("rechargeOrderCount").innerHTML = "0";
                    }
                    if (data.data.amount != null && data.data.amount != '') {
                        document.getElementById("amount").innerHTML = data.data.amount;
                    } else {
                        document.getElementById("amount").innerHTML = "0";
                    }
                    if (data.data.giveAmount != null && data.data.giveAmount != '') {
                        document.getElementById("giveAmount").innerHTML = data.data.giveAmount;
                    } else {
                        document.getElementById("giveAmount").innerHTML = '0';
                    }
                    if (data.data.factAmount != null && data.data.factAmount != '') {
                        document.getElementById("factAmount").innerHTML = data.data.factAmount;
                    } else {
                        document.getElementById("factAmount").innerHTML = '0';
                    }
                } else {
                    layer.msg(data.message);
                }
            }
        });
    }
        selectRechargeOrderStatistics();

        rechargeOrder.init1();
</script>
</body>
</html>
<script type="text/javascript">
    // $(function () {
    //     $('#paymentType').searchableSelect();
    //     $('#rechargeType').searchableSelect();
    // })
</script>